package cntedu.sp04.feign;


import cn.tedu.sa01.pojo.Item;
import cn.tedu.web.util.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

//指定调用的服务
//从注册表得到这个服务的地址
@FeignClient(name = "item-server")
public interface ItemClient {
       //获取订单的商品列表
    @GetMapping("/{orderId}")
       JsonResult<List<Item>>getItem(@PathVariable String orderId);
       //减少商品库存
    @PostMapping("/decreaseNumber")
       JsonResult<?>decreaseNumber(@RequestBody List<Item>items);
}
